#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;
const int N = 1010;
struct MoonCake {
    double store;
    double sell;
    double price;
}cake[N];

bool cmp(MoonCake a, MoonCake b)
{
    return a.price > b.price;
}

int main()
{
    int n;
    double D;
    scanf("%d%lf", &n, &D);
    for(int i = 0; i < n; i ++)
    {
        scanf("%lf", &cake[i].store);
    }
    for(int i = 0; i < n; i ++)
    {
        scanf("%lf", &cake[i].sell);
        cake[i].price = cake[i].sell / cake[i].store;
    }
    sort(cake, cake + n, cmp);
    double ans = 0;
    for(int i = 0; i < n; i ++)
    {
        if(cake[i].store <= D)
        {
            D -= cake[i].store;
            ans += cake[i].sell;
        } else {
            ans += cake[i].price * D;
            break;
        }
    }
    printf("%.2f\n", ans);
    return 0;
}